package cn.com.nes.site.controller.crm.sale.vo;

import cn.com.nes.site.modules.sale.bo.SaleBO;
import cn.com.nes.site.modules.sale.enums.SaleTypeEnum;
import cn.com.nes.site.service.crm.customer.bo.CustomerBO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

@ApiModel(value = "政府销售活动入参模型")
@Data
public class GovernmentSaleActivityVO {

    @ApiModelProperty(value = "公司ID", required = true)
    @NotEmpty(message = "公司")
    private String companyId;

    @ApiModelProperty(value = "活动类型：0-自主申报，1-设备更新")
    private String type;

    @ApiModelProperty(value = "项目UUID", required = true)
    @NotEmpty(message = "项目")
    private String projectUuid;

    @ApiModelProperty(value = "线索来源", required = true)
    @NotEmpty(message = "线索来源")
    private String clueSource;

    @ApiModelProperty(value = "申报类别：03-新增户，04-遗留户，05-设备更新", required = true)
    @NotEmpty(message = "申报类别")
    private String declarationCategory;

    @ApiModelProperty(value = "行政区划", required = true)
    @NotEmpty(message = "行政区划")
    private String areaCode;

    @ApiModelProperty(value = "手机号", required = true)
    @NotEmpty(message = "手机号")
    private String phone;

    @ApiModelProperty(value = "身份证照片人像面照片", required = true)
    @NotEmpty(message = "身份证照片人像面照片")
    private String idCardFrontPic;

    @ApiModelProperty(value = "身份证照片国徽面照片", required = true)
    @NotEmpty(message = "身份证照片国徽面照片")
    private String idCardBackPic;

    @ApiModelProperty(value = "户口本首页照片", required = true)
    @NotEmpty(message = "户口本首页照片")
    private String householdRegistrationBookHomePic;

    @ApiModelProperty(value = "户口本户主页照片", required = true)
    @NotEmpty(message = "户口本户主页照片")
    private String householdRegistrationBookHolderPic;

    @ApiModelProperty(value = "客户名称", required = true)
    @NotEmpty(message = "客户名称")
    private String customerName;

    @ApiModelProperty(value = "身份证号", required = true)
    @NotEmpty(message = "身份证号")
    private String idCardNumber;

    @ApiModelProperty(value = "地址", required = true)
    @NotEmpty(message = "地址")
    private String address;

    @ApiModelProperty(value = "门牌号", required = true)
    @NotEmpty(message = "门牌号")
    private String houseNumber;

    @ApiModelProperty(value = "能源类型：01-煤改电，02-煤改气", required = true)
    @NotEmpty(message = "能源类型")
    private String energyType;

    @ApiModelProperty(value = "电费发票照片")
    private String electricityInvoicePic;

    @ApiModelProperty(value = "电表用户姓名")
    private String electricityMeterUsername;

    @ApiModelProperty(value = "电表号")
    private String electricityMeterNumber;

    @ApiModelProperty(value = "电表地址")
    private String electricityMeterAddress;

    @ApiModelProperty(value = "燃气表号")
    private String gasMeterNumber;

    @ApiModelProperty(value = "新申报面积", required = true)
    @NotNull(message = "新申报面积")
    private BigDecimal newlyDeclaredArea;

    @ApiModelProperty(value = "住宅面积", required = true)
    @NotNull(message = "住宅面积")
    private BigDecimal houseArea;

    @ApiModelProperty(value = "原申报面积", required = true)
    @NotNull(message = "原申报面积")
    private BigDecimal originalDeclaredArea;

    @ApiModelProperty(value = "原申报面积地点ID", required = true)
    @NotEmpty(message = "原申报面积地点ID")
    private String originalDeclaredAreaHouseId;

    @ApiModelProperty(value = "原申报面积备注", required = true)
    @NotEmpty(message = "原申报面积备注")
    private String originalDeclaredAreaDesc;

    @ApiModelProperty(value = "户籍情况：01-本地，02-非本地")
    private String householdRegistration;

    @ApiModelProperty(value = "长期居住证明照片")
    private String longTermResidenceCertificatePic;

    @ApiModelProperty(value = "未享受补贴证明照片")
    private String unEnjoySubsidiesCertificatePic;

    @ApiModelProperty(value = "特殊情况证明照片")
    private String specialCircumstancesCertificatePic;

    @ApiModelProperty(value = "是否安装光伏")
    private Boolean installPhotovoltaic;


    public SaleBO buildSaleBO() {
        SaleBO saleBO = new SaleBO();
        saleBO.setSaleType(SaleTypeEnum.GOVERNMENT_PERSONAL_SALES);
        saleBO.setInstallPhotovoltaic(this.getInstallPhotovoltaic());

        CustomerBO customerBO = new CustomerBO();
        customerBO.setAddCustomer(Boolean.TRUE);
        return saleBO;
    }

}
